#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QDesktopServices>
#include <QFileInfo>
#include <QHideEvent>
#include <QMainWindow>
#include <QMenu>
#include <QMessageBox>
#include <QSettings>
#include <QShowEvent>
#include <QSystemTrayIcon>
#include <QWebFrame>

#include "cookiejar.h"
#include "settingsdialog.h"

#define APP_DESKTOP_URL QString("http://saydanke.ru/tvoeradio/php/desktop-login.php?v=")+qApp->applicationVersion()
#define APP_URL QString("http://vkontakte.ru/app1832282")
#define CLUB_URL QString("http://vkontakte.ru/club16049689")
#define HELP_URL QString("http://vkontakte.ru/pages.php?o=-1001832282&p=%CF%EE%EC%EE%F9%FC")

#define u(s) QString::fromUtf8(s)

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_browser_urlChanged(QUrl );
    void on_browser_linkClicked(QUrl url);
public slots:
    void quit();
    void showHide();
    void showHide(QSystemTrayIcon::ActivationReason reason);
    void playPause();
    void next();
    void stop();
    void about();
    void openSettingsDialog();


protected:
    void hideEvent(QHideEvent *);
    void showEvent(QShowEvent *);

private:
    Ui::MainWindow *ui;
    QAction *showHideAction;
    QAction *quitAction;
    QAction *playPauseAction;
    QAction *nextAction;
    QAction *stopAction;
    QAction *aboutAction;
    QAction *openSettingsDialogAction;
    QSystemTrayIcon *trayIcon;
    QMenu *trayIconMenu;
    SettingsDialog *settingsDialog;

};

#endif // MAINWINDOW_H
